<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel app\models\search\PointConsumeSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '积分消费';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="point-consume-index">
    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [

            'id',
            [

                'attribute'=>'uid',
                'format'=>'raw',
                'value'=>function($model){
                    return $model->user->showAvatar().'<br/>'.$model->user->nickname;
                }
            ],
            'consume_date',
            [

                'attribute'=>'consume_type',
                'filter'=>\app\models\PointConsume::$type_arr,
//                'format'=>'raw',
                'value'=>function($model){
                    return $model->showType();
                }
            ],
            'consume_point',
            [

                'attribute'=>'consume_value',
//                'filter'=>false,
//                'format'=>'raw',
                'value'=>function($model){
                    return $model->showConsumeValue();
                }
            ],
        ],
    ]); ?>


</div>
